#ifndef __OBJECTSCENE_H__
#define __OBJECTSCENE_H__

#include <AGTRenderSystem/RenderManager.h>
#include "ObjectSceneManager.h"

using namespace std;
/*
	Represents one scene in the game:
	- A scene can be a part of a world, an outside town, or interior buildings 

	TODO:
	- Add waypoints on scene later on the game
*/

class ObjectSceneManager;

class ObjectScene
{
protected:
	string					m_SceneName;				// Unique ID name for each scene
	Object*					m_PlayerObject;				// Player object passed into different scenes
	ObjectManager*			m_ObjMgr;					// Storage of objects in scene
	Ogre::SceneManager*		m_SceneMgr;					// Pointer to Ogre Scene manager



	virtual bool addToManager(void)=0;			// Must be declared and implemented. This calls the scene manager and
												// adds itself to the store.
public:
	ObjectScene(){
		m_SceneName = "DefaultScene"; 
		m_PlayerObject=NULL; 
		m_ObjMgr = new ObjectManager(); 
	};
	~ObjectScene(){};
	Ogre::SceneManager* getOSceneMgr(void)
	{
		if(m_SceneMgr != NULL)
			return m_SceneMgr;
		return NULL;
	};
	virtual string getName(void){ return m_SceneName; };
	virtual Object* getPlayerObject(void){ return m_PlayerObject; };
	virtual ObjectManager* getObjManager(void){ return m_ObjMgr; };

	// First initialise ogre scene properties
	virtual void setupScene(void)=0;			
	virtual void createScene(void)=0;			// Second: add objects to scene here
												// NOTE: all objects must be added to the ObjectManager to get updated
	

	virtual void update()
	{
		if(m_ObjMgr != NULL)
			m_ObjMgr->updateObjects();
	}
};


#endif